<?php
/**
 * @version 1.0
 * @author jonathan <jo.link.noir@gmail.com>
 * @date 17-04-2010
 */
class U1_Units extends SW_Units
{
	/**
	 * @return U1_Army_Unity|null
	 */
	public function createUnity($group, $count)
	{
		return ($count > 0) ? new U1_Unit((int)$group, $count) : null;
	}

	/**
	 * Additionne les statistiques de chaque vaisseaux
	 * @param mixed $stat
	 * @return int
	 * @code
		$get = 0;
		foreach ($this->army as $unit)
			$get += $unit->getStat($stat);
		return $get;
	 * @endcode
	 */
	public function getStat($stat)
	{
		$get = 0;
		foreach ($this->units as $unit)
			$get += $unit->getStat($stat);
		return $get;
	}
}